package com.happyfamily.springboot.crowdsourcingplatform.controller.weng;

import com.alibaba.druid.stat.DruidStatManagerFacade;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api-back")
public class DruidStatController
{
	@GetMapping("/druid/stat")
	@ApiOperation(value = "查看数据库连接池情况", notes = "查看数据库连接池情况", httpMethod = "GET", response = Object.class)
	public Object druidStat()
	{
		// DruidStatManagerFacade#getDataSourceStatDataList 该方法可以获取所有数据源的监控数据，除此之外 DruidStatManagerFacade 还提供了一些其他方法，你可以按需选择使用。
		return DruidStatManagerFacade.getInstance().getDataSourceStatDataList();
	}
}
